var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var consumeHandler = require('../../../app/servers/bag/handler/consumeHandler');
var config = require('../../config');
var PlayerManager = require('../../../app/libs/playerManager');
var configUtil = require('../../../app/util/configUtil');
var analyze = require('kc-analyze');
var consumeType = require('../../../app/consts/consumeType');
suite('统计数据', function () {
    test('初始化', function (done) {
        var analyze_config = configUtil.load('analyze');
        var game_config = configUtil.load('game');
        analyze.initialize({
            host: analyze_config.host,
            server_id: game_config.server_id
        });
        done();
    });
});

suite('bag.consumeHandler.use', function () {
    test('bag.consumeHandler.use', function (done) {

        var msg = {
            consume_id: 5001501,
            build_id: 20401,
            num: 1,
            quick_type: 3
        };
        var session = {};
        session.uid = config.role_id;

        var consume_handler = new consumeHandler();
        consume_handler.use(msg, session, function (err, res) {
            console.log(res);
            done();
        });
    });
});

// suite('bag.consumeHandler.consumeBuy', function () {
//     test('bag.consumeHandler.consumeBuy', function (done) {

//         var msg = {
//             build_id: 20401,
//             gain_type: 2
//         };
//         var session = {};
//         session.uid = config.role_id;

//         var consume_handler = new consumeHandler();
//         consume_handler.consumeBuy(msg, session, function (err, res) {
//             console.log(res);
//             done();
//         });
//     });
// });
